/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package ged.impl;

import ged.BorderInnerMargin;
import ged.GedPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Border Inner Margin</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link ged.impl.BorderInnerMarginImpl#getInner_margin_top <em>Inner margin top</em>}</li>
 *   <li>{@link ged.impl.BorderInnerMarginImpl#getInner_margin_bottom <em>Inner margin bottom</em>}</li>
 *   <li>{@link ged.impl.BorderInnerMarginImpl#getInner_margin_left <em>Inner margin left</em>}</li>
 *   <li>{@link ged.impl.BorderInnerMarginImpl#getInner_margin_right <em>Inner margin right</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class BorderInnerMarginImpl extends EObjectImpl implements BorderInnerMargin
{
  /**
   * The default value of the '{@link #getInner_margin_top() <em>Inner margin top</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getInner_margin_top()
   * @generated
   * @ordered
   */
  protected static final int INNER_MARGIN_TOP_EDEFAULT = 0;

  /**
   * The cached value of the '{@link #getInner_margin_top() <em>Inner margin top</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getInner_margin_top()
   * @generated
   * @ordered
   */
  protected int inner_margin_top = INNER_MARGIN_TOP_EDEFAULT;

  /**
   * The default value of the '{@link #getInner_margin_bottom() <em>Inner margin bottom</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getInner_margin_bottom()
   * @generated
   * @ordered
   */
  protected static final int INNER_MARGIN_BOTTOM_EDEFAULT = 0;

  /**
   * The cached value of the '{@link #getInner_margin_bottom() <em>Inner margin bottom</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getInner_margin_bottom()
   * @generated
   * @ordered
   */
  protected int inner_margin_bottom = INNER_MARGIN_BOTTOM_EDEFAULT;

  /**
   * The default value of the '{@link #getInner_margin_left() <em>Inner margin left</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getInner_margin_left()
   * @generated
   * @ordered
   */
  protected static final int INNER_MARGIN_LEFT_EDEFAULT = 0;

  /**
   * The cached value of the '{@link #getInner_margin_left() <em>Inner margin left</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getInner_margin_left()
   * @generated
   * @ordered
   */
  protected int inner_margin_left = INNER_MARGIN_LEFT_EDEFAULT;

  /**
   * The default value of the '{@link #getInner_margin_right() <em>Inner margin right</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getInner_margin_right()
   * @generated
   * @ordered
   */
  protected static final int INNER_MARGIN_RIGHT_EDEFAULT = 0;

  /**
   * The cached value of the '{@link #getInner_margin_right() <em>Inner margin right</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getInner_margin_right()
   * @generated
   * @ordered
   */
  protected int inner_margin_right = INNER_MARGIN_RIGHT_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected BorderInnerMarginImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return GedPackage.Literals.BORDER_INNER_MARGIN;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public int getInner_margin_top()
  {
    return inner_margin_top;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setInner_margin_top(int newInner_margin_top)
  {
    int oldInner_margin_top = inner_margin_top;
    inner_margin_top = newInner_margin_top;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, GedPackage.BORDER_INNER_MARGIN__INNER_MARGIN_TOP, oldInner_margin_top, inner_margin_top));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public int getInner_margin_bottom()
  {
    return inner_margin_bottom;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setInner_margin_bottom(int newInner_margin_bottom)
  {
    int oldInner_margin_bottom = inner_margin_bottom;
    inner_margin_bottom = newInner_margin_bottom;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, GedPackage.BORDER_INNER_MARGIN__INNER_MARGIN_BOTTOM, oldInner_margin_bottom, inner_margin_bottom));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public int getInner_margin_left()
  {
    return inner_margin_left;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setInner_margin_left(int newInner_margin_left)
  {
    int oldInner_margin_left = inner_margin_left;
    inner_margin_left = newInner_margin_left;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, GedPackage.BORDER_INNER_MARGIN__INNER_MARGIN_LEFT, oldInner_margin_left, inner_margin_left));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public int getInner_margin_right()
  {
    return inner_margin_right;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setInner_margin_right(int newInner_margin_right)
  {
    int oldInner_margin_right = inner_margin_right;
    inner_margin_right = newInner_margin_right;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, GedPackage.BORDER_INNER_MARGIN__INNER_MARGIN_RIGHT, oldInner_margin_right, inner_margin_right));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case GedPackage.BORDER_INNER_MARGIN__INNER_MARGIN_TOP:
        return getInner_margin_top();
      case GedPackage.BORDER_INNER_MARGIN__INNER_MARGIN_BOTTOM:
        return getInner_margin_bottom();
      case GedPackage.BORDER_INNER_MARGIN__INNER_MARGIN_LEFT:
        return getInner_margin_left();
      case GedPackage.BORDER_INNER_MARGIN__INNER_MARGIN_RIGHT:
        return getInner_margin_right();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case GedPackage.BORDER_INNER_MARGIN__INNER_MARGIN_TOP:
        setInner_margin_top((Integer)newValue);
        return;
      case GedPackage.BORDER_INNER_MARGIN__INNER_MARGIN_BOTTOM:
        setInner_margin_bottom((Integer)newValue);
        return;
      case GedPackage.BORDER_INNER_MARGIN__INNER_MARGIN_LEFT:
        setInner_margin_left((Integer)newValue);
        return;
      case GedPackage.BORDER_INNER_MARGIN__INNER_MARGIN_RIGHT:
        setInner_margin_right((Integer)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case GedPackage.BORDER_INNER_MARGIN__INNER_MARGIN_TOP:
        setInner_margin_top(INNER_MARGIN_TOP_EDEFAULT);
        return;
      case GedPackage.BORDER_INNER_MARGIN__INNER_MARGIN_BOTTOM:
        setInner_margin_bottom(INNER_MARGIN_BOTTOM_EDEFAULT);
        return;
      case GedPackage.BORDER_INNER_MARGIN__INNER_MARGIN_LEFT:
        setInner_margin_left(INNER_MARGIN_LEFT_EDEFAULT);
        return;
      case GedPackage.BORDER_INNER_MARGIN__INNER_MARGIN_RIGHT:
        setInner_margin_right(INNER_MARGIN_RIGHT_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case GedPackage.BORDER_INNER_MARGIN__INNER_MARGIN_TOP:
        return inner_margin_top != INNER_MARGIN_TOP_EDEFAULT;
      case GedPackage.BORDER_INNER_MARGIN__INNER_MARGIN_BOTTOM:
        return inner_margin_bottom != INNER_MARGIN_BOTTOM_EDEFAULT;
      case GedPackage.BORDER_INNER_MARGIN__INNER_MARGIN_LEFT:
        return inner_margin_left != INNER_MARGIN_LEFT_EDEFAULT;
      case GedPackage.BORDER_INNER_MARGIN__INNER_MARGIN_RIGHT:
        return inner_margin_right != INNER_MARGIN_RIGHT_EDEFAULT;
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (inner_margin_top: ");
    result.append(inner_margin_top);
    result.append(", inner_margin_bottom: ");
    result.append(inner_margin_bottom);
    result.append(", inner_margin_left: ");
    result.append(inner_margin_left);
    result.append(", inner_margin_right: ");
    result.append(inner_margin_right);
    result.append(')');
    return result.toString();
  }

} //BorderInnerMarginImpl
